﻿/// <reference path="../vsdoc/jquery-1.8.3-vsdoc.js" />

/*
** settings for resizing bar
*/

// cookie name
var UiMoveAndResizeBar = "resizeBar_position_left";

$(document).ready(function ()
{
    $("#masterMove").draggable({ axis: "x" });
    $("#masterMove").bind("drag", function (event, ui)
    {
        if (ui.position.left < 100)
        {
            ui.position.left = 100;
        }
        if (ui.position.left > 400)
        {
            ui.position.left = 400;
        }
    });
    $("#masterMove").bind("dragstop", function (event, ui)
    {
        var positionLeft = ui.position.left + 3;
        $("#masterMenu").css("width", (positionLeft - 11) + "px");
        $("#masterUser").css("width", (positionLeft - 27) + "px");
        $("#masterBody").css("left", (positionLeft) + "px");
        $("#masterButt").css("left", (positionLeft) + "px");
        $.cookie(UiMoveAndResizeBar, positionLeft, { expires: 7, path: '/' });
    });
});